#ifndef CGRAPHICS_H_
#define CGRAPHICS_H_

#include "TSingleton.h"
#include "CColor.h"
#include <string>
#include "CFontEngine.h"


class CSprite;


namespace FBShells {	
	class CGraphics {
		protected:
			CFontEngine* m_fontEngine;
		public:
			CGraphics() { }
			
			// All needed initialization calls for the graphics backend
			virtual bool Initialize(unsigned int w, unsigned int h, bool fullscreen) = 0;
			
			// All needed shutdown calls for the graphics bakend
			virtual bool Shutdown() = 0;
			
			// Creates the window and/or rendering template
			virtual void CreateScreen() = 0;
			
			// Draws a primitive circle to the screen. Unga bunga!
			virtual bool drawCircle(int x, int y, int radius, const CColor& color, bool fill) = 0;
			
			// Draws a primitive rectangle to the screen.
			virtual bool drawRect(int x, int y, int x2, int y2, const CColor& color, bool fill) = 0;
			
			// Draws a primitive triangle to the screen.
			virtual bool drawTriangle(int x, int y, int x2, int y2, int x3, int y3, const CColor& color, bool fill) = 0;

			// Draws a primitive line to the screen.
			virtual bool drawLine(int x, int y, int x2, int y2, const CColor& color) = 0;
			
			// Draws a sprite to the screen.
			virtual bool drawSprite(CSprite* sprite) = 0;
			
			// // Draws a primitive sprite to the screen.
			// virtual static bool drawCaveman(CSprite* caveman) = 0;
			
			// Draws a string to the screen. Overloaded for both std::string and char*.
			virtual bool drawString(int x, int y, std::string text, const CColor& facecolor, const CColor& background) = 0;
			virtual bool drawString(int x, int y, const char* text, const CColor& facecolor, const CColor& background) = 0;
			
			// Creates a sprite in RAM
			virtual CSprite* createSprite(std::string filename) = 0;
			virtual CSprite* createSprite(const char* filename) = 0;
						
			virtual void renderScreen() = 0;
			
			virtual ~CGraphics() { }
	};

	extern TSingleton<CGraphics> FBGraphics;
};

	
#endif /*CGRAPHICS_H_*/
